package com.cgwx.config;

import com.cgwx.Utils.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(BusinessException.class)
    public Result handleBusinessException(BusinessException ex) {
        Result result = new Result();
        result.setStatus(200);
        result.setMessage(ex.getMessage());
        return result;
    }
}